POV-Ray : Newsgroups : povray.general : Buggy trig? : Buggy trig? Server Time
9 Aug 2024 17:16:25 EDT (-0400)
  Buggy trig?  
From: Xplo Eristotle
Date: 3 Jun 2000 20:14:26
Message: <39399F72.5F639DC0@unforgettable.com>
Playing with the animation stuff, I produced this simple scene:

#version unofficial MegaPov 0.5;

camera
	{
	location <0.0, 0, -4>
	look_at <0.0, 0.0, 0.0>
	}

light_source
	{
	<-4, 8, -4>
	rgb .3
	}

text
	{
	ttf "ALIANNA.TTF",
	"RAYTRACING"
	1, <0.0, 0.0, 0.0>
	align_center
	pigment { color rgb <0, 1, 0> }
	rotate <0,-20*(sin(clock*360)),0>
	}

As I understand it, this should produce a nice loop; starting from no
rotation (clock = 0, sin(0) = 0), the right end of the text should be
rotated toward the camera while the left end falls away until a quarter
of the way through the animation, where the rotation reaches -20 degrees
(clock = ~.25, sin(360*.25) = 1). Then, it should rotate back the way it
came until halfway through (sin(360*.5) = 0) and then keep rotating that
direction until 3/4 of the way through the animation where it reaches 20
degrees (sin(360*.75) = -1). And finally, it should rotate back again
until it reaches no rotation.

Problem: it doesn't do this. It seems like the sin function is returning
incorrect values, since when I rendered the animation and dumped the
frames in a GIF animator, the animation didn't describe a full loop.
Instead, it acted as though the function had been sin(clock*270),
starting from no rotation and ending up at 20 degrees rotation.

Can anyone either explain what I'm doing wrong, or reproduce this bug?

-- 
Xplo Eristotle
http://start.at/xplosion/

"And then one day you find ten years have got behind you
No one told you when to run, you missed the starting gun"
    -Pink Floyd


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.